<template>
    <view>
      <view class="list" v-for="item in list">
        <view class="title">
          {{item.type==1?'+':'-'}}{{item.integral}}
        </view>
        <view class="text">
          <view>{{item.create_time}}</view>
          <view>{{item.remark}}</view>
        </view>
      </view>
    </view>
</template>
<script>
import {
		mapState,
		mapActions,
		mapMutations
	} from "vuex"
export default {
   data() {
      return {
        list:[],
      }
   },
   async onLoad() {
			await this.initIndex()
		},
    computed: mapState({
			primaryColor: state => state.config.configInfo.primaryColor,
			subColor: state => state.config.configInfo.subColor,
			configInfo: state => state.config.configInfo,
			userInfo: state => state.user.userInfo,
		}),
   methods:{
    ...mapActions(['getConfigInfo']),
    async initIndex(refresh = false) {
				// #ifdef H5
				if (!refresh && this.$jweixin.isWechat()) {
					await this.$jweixin.initJssdk();
					this.$jweixin.wxReady(() => {
						this.$jweixin.hideOptionMenu()
					})
				}
				// #endif
				if (!this.configInfo.id || refresh) {
					await this.getConfigInfo()
				}
				await this.integralWater()
        this.$util.setNavigationBarColor({
					bg: this.primaryColor
				})
			},
      async integralWater(){
        this.list = await this.$api.order.integralWater()
      },
   },
}
</script>
<style lang="scss">
.list{
  margin: 40rpx;
  padding: 20rpx 60rpx;
  border-radius: 10rpx;
  background-color: #fff;
  display: flex;
  justify-content: space-between;
  align-items:center;
}
.title{
  font-weight: 600;
  font-size: 36rpx;
  margin-right: 40rpx;
}
.text{
  font-size: 32rpx;
}
</style>
